# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ServiceUsage.V1.Model.GoogleApiServiceusageV1ServiceConfig do
  @moduledoc """
  The configuration of the service.

  ## Attributes

  *   `apis` (*type:* `list(GoogleApi.ServiceUsage.V1.Model.Api.t)`, *default:* `nil`) - A list of API interfaces exported by this service. Contains only the names, versions, and method names of the interfaces.
  *   `authentication` (*type:* `GoogleApi.ServiceUsage.V1.Model.Authentication.t`, *default:* `nil`) - Auth configuration. Contains only the OAuth rules.
  *   `documentation` (*type:* `GoogleApi.ServiceUsage.V1.Model.Documentation.t`, *default:* `nil`) - Additional API documentation. Contains only the summary and the documentation URL.
  *   `endpoints` (*type:* `list(GoogleApi.ServiceUsage.V1.Model.Endpoint.t)`, *default:* `nil`) - Configuration for network endpoints. Contains only the names and aliases of the endpoints.
  *   `monitoredResources` (*type:* `list(GoogleApi.ServiceUsage.V1.Model.MonitoredResourceDescriptor.t)`, *default:* `nil`) - Defines the monitored resources used by this service. This is required by the Service.monitoring and Service.logging configurations.
  *   `monitoring` (*type:* `GoogleApi.ServiceUsage.V1.Model.Monitoring.t`, *default:* `nil`) - Monitoring configuration. This should not include the 'producer_destinations' field.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The DNS address at which this service is available. An example DNS address would be: `calendar.googleapis.com`.
  *   `quota` (*type:* `GoogleApi.ServiceUsage.V1.Model.Quota.t`, *default:* `nil`) - Quota configuration.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The product title for this service.
  *   `usage` (*type:* `GoogleApi.ServiceUsage.V1.Model.Usage.t`, *default:* `nil`) - Configuration controlling usage of this service.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :apis => list(GoogleApi.ServiceUsage.V1.Model.Api.t()) | nil,
          :authentication => GoogleApi.ServiceUsage.V1.Model.Authentication.t() | nil,
          :documentation => GoogleApi.ServiceUsage.V1.Model.Documentation.t() | nil,
          :endpoints => list(GoogleApi.ServiceUsage.V1.Model.Endpoint.t()) | nil,
          :monitoredResources =>
            list(GoogleApi.ServiceUsage.V1.Model.MonitoredResourceDescriptor.t()) | nil,
          :monitoring => GoogleApi.ServiceUsage.V1.Model.Monitoring.t() | nil,
          :name => String.t() | nil,
          :quota => GoogleApi.ServiceUsage.V1.Model.Quota.t() | nil,
          :title => String.t() | nil,
          :usage => GoogleApi.ServiceUsage.V1.Model.Usage.t() | nil
        }

  field(:apis, as: GoogleApi.ServiceUsage.V1.Model.Api, type: :list)
  field(:authentication, as: GoogleApi.ServiceUsage.V1.Model.Authentication)
  field(:documentation, as: GoogleApi.ServiceUsage.V1.Model.Documentation)
  field(:endpoints, as: GoogleApi.ServiceUsage.V1.Model.Endpoint, type: :list)

  field(:monitoredResources,
    as: GoogleApi.ServiceUsage.V1.Model.MonitoredResourceDescriptor,
    type: :list
  )

  field(:monitoring, as: GoogleApi.ServiceUsage.V1.Model.Monitoring)
  field(:name)
  field(:quota, as: GoogleApi.ServiceUsage.V1.Model.Quota)
  field(:title)
  field(:usage, as: GoogleApi.ServiceUsage.V1.Model.Usage)
end

defimpl Poison.Decoder, for: GoogleApi.ServiceUsage.V1.Model.GoogleApiServiceusageV1ServiceConfig do
  def decode(value, options) do
    GoogleApi.ServiceUsage.V1.Model.GoogleApiServiceusageV1ServiceConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ServiceUsage.V1.Model.GoogleApiServiceusageV1ServiceConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
